<div id="tasks">

	<div class="single-head">
		<h3 class="pull-left"><i class="fa fa-desktop purple"></i> <?php echo Rights::t('core', 'Tasks'); ?></h3>
		<div class="breads pull-right">
			<strong>Nav</strong> : <a href="<?php echo Yii::app()->createUrl('User'); ?>">Home</a>  / Rigths / Tasks
		</div>
		<div class="clearfix"></div>
	</div>
	
	<?php 
		$this->beginWidget('zii.widgets.CPortlet', array(
			'htmlOptions'=>array(
				'class'=>''
			)
		));
		$this->widget('bootstrap.widgets.TbMenu', array(
			'type'=>'pills',
			'items'=>array(
				array('label'=>'Assignments', 'url'=>Yii::app()->controller->createUrl('assignment/view'), 'linkOptions'=>array()),
				array('label'=>'Permissions', 'url'=>Yii::app()->controller->createUrl('authItem/permissions'), 'linkOptions'=>array()),
				array('label'=>'Roles', 'url'=>Yii::app()->controller->createUrl('authItem/roles'),  'linkOptions'=>array()),
				array('label'=>'Tasks', 'url'=>Yii::app()->controller->createUrl('authItem/tasks'), 'active'=>true,'linkOptions'=>array()),
				array('label'=>'Operations', 'url'=>Yii::app()->controller->createUrl('authItem/operations'), 'linkOptions'=>array()),
			),
		));
		$this->endWidget();
	?>
	<p>
		<?php echo Rights::t('core', 'A task is a permission to perform multiple operations, for example accessing a group of controller action.'); ?><br />
		<?php echo Rights::t('core', 'Tasks exist below roles in the authorization hierarchy and can therefore only inherit from other tasks and/or operations.'); ?>
	</p>

	<p><?php echo CHtml::link(Rights::t('core', 'Create a new task'), array('authItem/create', 'type'=>CAuthItem::TYPE_TASK), array(
		'class'=>'add-task-link',
	)); ?></p>

	<?php $this->widget('bootstrap.widgets.TbGridView', array(
	    'dataProvider'=>$dataProvider,
	    'template'=>'{items}',
		'type'=>'striped bordered condensed',
	    'emptyText'=>Rights::t('core', 'No tasks found.'),
	    'htmlOptions'=>array('class'=>'grid-view task-table'),
	    'columns'=>array(
    		array(
    			'name'=>'name',
    			'header'=>Rights::t('core', 'Name'),
    			'type'=>'raw',
    			'htmlOptions'=>array('class'=>'name-column'),
    			'value'=>'$data->getGridNameLink()',
    		),
    		array(
    			'name'=>'description',
    			'header'=>Rights::t('core', 'Description'),
    			'type'=>'raw',
    			'htmlOptions'=>array('class'=>'description-column'),
    		),
    		array(
    			'name'=>'bizRule',
    			'header'=>Rights::t('core', 'Business rule'),
    			'type'=>'raw',
    			'htmlOptions'=>array('class'=>'bizrule-column'),
    			'visible'=>Rights::module()->enableBizRule===true,
    		),
    		array(
    			'name'=>'data',
    			'header'=>Rights::t('core', 'Data'),
    			'type'=>'raw',
    			'htmlOptions'=>array('class'=>'data-column'),
    			'visible'=>Rights::module()->enableBizRuleData===true,
    		),
    		array(
    			'header'=>'&nbsp;',
    			'type'=>'raw',
    			'htmlOptions'=>array('class'=>'actions-column'),
    			'value'=>'$data->getDeleteTaskLink()',
    		),
	    )
	)); ?>

	<p class="info"><?php echo Rights::t('core', 'Values within square brackets tell how many children each item has.'); ?></p>

</div>